Skip to content

Add test and fix for categorical series .shift #10495. #10498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

cottrell
Copy link
Contributor

@cottrell cottrell commented Jul 3, 2015

#10495

Waiting for Travis and will review further.

f_ordered = new_values.flags.f_contiguous

f_ordered = False
if not isinstance(new_values, Categorical):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just define .flags on Categorical (on the codes array)

@sinhrks sinhrks added Bug Categorical Categorical Data Type labels Jul 3, 2015
@sinhrks sinhrks added this to the 0.17.0 milestone Jul 3, 2015
@sinhrks
Copy link
Member

sinhrks commented Jul 3, 2015

Pls add release note to doc/source/whatsnew/v0.17.0.txt

for v in values:
for shift in shifts:
a = pd.Series(v).shift(shift)
b = pd.Series(v, dtype='category').shift(shift)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to assert that the result series is equal
so construct the expected result as series

@jreback
Copy link
Contributor

jreback commented Jul 6, 2015

#10497 fixes this i believe. But pls check.

@jreback
Copy link
Contributor

jreback commented Jul 6, 2015

#10497 is a much better way to do this

@jreback jreback closed this Jul 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Categorical Categorical Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants